import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/Index.vue'

export const constantRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    component: Layout,
    name: 'dashboard',
    redirect: '/dashboard',
    meta: {
      title: "首页菜单",
      icon: "HomeFilled"
    },
    children: [
      {
        path: '/dashboard',
        component: () => import('@/view/dashboard/Index.vue'),
        name: 'dashboardIndex',
        meta: {
          title: '首页',
          icon: 'HomeFilled'
        }
      }
    ]
  },

  {
    path: '/organization',
    component: Layout,
    name: 'organization',
    meta: {
      title: "系统人员管理",
      icon: "HomeFilled"
    },
    children: [
      {
        path: '/03Organization/01User/index',
        component: () => import('@/view/03Organization/01User/index.vue'),
        name: '01User',
        meta: {
          title: '用户管理',
          icon: 'HomeFilled'
        }
      },
      {
        path: '/03Organization/02Department/index',
        component: () => import('@/view/03Organization/02Department/index.vue'),
        name: '02Department',
        meta: {
          title: '部门管理',
          icon: 'HomeFilled'
        }
      },
      {
        path: '/03Organization/03Role/index',
        component: () => import('@/view/03Organization/03Role/index.vue'),
        name: '03Role',
        meta: {
          title: '角色管理',
          icon: 'HomeFilled'
        }
      },
      {
        path: '/03Organization/04Menu/index',
        component: () => import('@/view/03Organization/04Menu/index.vue'),
        name: '04Menu',
        meta: {
          title: '菜单管理',
          icon: 'HomeFilled'
        }
      },
    ]
  },
  {
    path: '/organization',
    component: Layout,
    name: 'organization',
    meta: {
      title: "系统人员管理",
      icon: "HomeFilled"
    },
    children: [
      {
        path: '/03Organization/01User/index',
        component: () => import('@/view/03Organization/01User/index.vue'),
        name: '01User',
        meta: {
          title: '用户管理',
          icon: 'HomeFilled'
        }
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/view/Login/index.vue'),
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes: constantRoutes
})
export default router